<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
  <!--<![endif]-->
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>GARO ESTATE | Property page</title>
    <meta name="description" content="company is a real-estate template" />
    <meta name="author" content="Kimarotec" />
    <meta
      name="keyword"
      content="html5, css, bootstrap, property, real-estate theme , bootstrap template"
    />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <link
      href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,700,800"
      rel="stylesheet"
      type="text/css"
    />

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="icon" href="favicon.ico" type="image/x-icon" />

    <link rel="stylesheet" href="./HotelUser/assets/css/normalize.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/fontello.css" />
    <link
      href="./HotelUser/assets/fonts/icon-7-stroke/css/pe-icon-7-stroke.css"
      rel="stylesheet"
    />
    <link
      href="./HotelUser/assets/fonts/icon-7-stroke/css/helper.css"
      rel="stylesheet"
    />
    <link
      href="./HotelUser/assets/css/animate.css"
      rel="stylesheet"
      media="screen"
    />
    <link
      rel="stylesheet"
      href="./HotelUser/assets/css/bootstrap-select.min.css"
    />
    <link rel="stylesheet" href="./HotelUser/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/icheck.min_all.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/price-range.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/owl.carousel.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/owl.theme.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/owl.transitions.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/lightslider.min.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/style.css" />
    <link rel="stylesheet" href="./HotelUser/assets/css/responsive.css" />
    <link rel="stylesheet" type="text/css" href="res/static/css/main.css" />
    <link rel="stylesheet" type="text/css" href="res/layui/css/layui.css" />
    <script type="text/javascript" src="res/layui/layui.js"></script>
  </head>
  <body>
    <div id="preloader">
      <div id="status">&nbsp;</div>
    </div>
    <!-- Body content -->

    <div class="header-connect">
      <div class="container">
        <div class="row">
          <div class="col-md-5 col-sm-8 col-xs-12">
            <div class="header-half header-call">
              <p>
                <span><i class="pe-7s-call"></i> +1 234 567 7890</span>
                <span><i class="pe-7s-mail"></i> your@company.com</span>
              </p>
            </div>
          </div>
          <div
            class="col-md-2 col-md-offset-5 col-sm-3 col-sm-offset-1 col-xs-12"
          >
            <div class="header-half header-social">
              <!-- <ul class="list-inline">
                                <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                                <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                                <li><a href="#"><i class="fa fa-vine"></i></a></li>
                                <li><a href="#"><i class="fa fa-linkedin"></i></a></li>
                                <li><a href="#"><i class="fa fa-dribbble"></i></a></li>
                                <li><a href="#"><i class="fa fa-instagram"></i></a></li>
                            </ul> -->
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--End top header -->
    <nav class="navbar navbar-default">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button
            type="button"
            class="navbar-toggle collapsed"
            data-toggle="collapse"
            data-target="#navigation"
          >
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index.html"
            ><img src="./HotelUser/assets/img/logo.png" alt=""
          /></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse yamm" id="navigation">
          <div class="button navbar-right">
            <!-- <button
              class="navbar-btn nav-button wow bounceInRight login"
              onclick=" window.open('register.html')"
              data-wow-delay="0.4s"
            >
              Login
            </button>
            <button
              class="navbar-btn nav-button wow fadeInRight"
              onclick=" window.open('submit-property.html')"
              data-wow-delay="0.5s"
            >
              Submit
            </button> -->
          </div>
          <ul class="main-nav nav navbar-nav navbar-right">
            <li class="dropdown ymm-sw" data-wow-delay="0.1s">
              <a
                href="./HotelUser-message&ordes.html"
                class="dropdown-toggle"

                >个人中心<b class="caret"></b
              ></a>
            </li>

            <li class="wow fadeInDown" data-wow-delay="0.1s">
              <a class="dropdown-toggle" href="./HotelUser-hotel.html"
                >预订酒店</a
              >
            </li>
            <li class="wow fadeInDown" data-wow-delay="0.1s">
              <a class="dropdown- active" href="./HotelUser-shop.html"
                >精品商城</a
              >
            </li>
            <li class="dropdown yamm-fw" data-wow-delay="0.1s">
              <a
                href="./HotelUser-food.html"
                class="dropdown-toggle"

                >点餐堂食</a
              >
            </li>

            <!-- <li class="wow fadeInDown" data-wow-delay="0.4s">
              <a href="contact.html">尊享服务</a>
            </li> -->
          </ul>
        </div>
        <!-- /.navbar-collapse -->
      </div>
      <!-- /.container-fluid -->
    </nav>
    <!-- End of nav bar -->

    <div class="page-head">
      <div class="container">
        <div class="row">
          <div class="page-head-content">
            <h1 class="page-title">凤嘉昶客栈</h1>
          </div>
        </div>
      </div>
    </div>
    <!-- End page header -->

    <!-- property area -->

    <div class="site-nav-bg">
      <div class="site-nav w1200">
        <!-- <p class="sn-back-home">
                <i class="layui-icon layui-icon-home"></i>
                <a href="#">首页</a>
              </p> -->
        <div class="sn-quick-menu">
          <!-- <div class="login"><a href="login.html">登录</a></div> -->
          <div class="sp-cart">
            <a href="./HotelUser-shopcart.html"><h4>购物车</h4></a>
          </div>
        </div>
      </div>
    </div>

    <!--         
          <div class="header">
            <div class="headerLayout w1200">
              <div class="headerCon">
                <h1 class="mallLogo">
                  <a href="#" title="母婴商城">
                    <img src="res/static/img/logo.png">
                  </a>
                </h1>
                <div class="mallSearch">
                  <form action="" class="layui-form" novalidate>
                    <input type="text" name="title" required  lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入需要的商品">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">
                        <i class="layui-icon layui-icon-search"></i>
                    </button>
                    <input type="hidden" name="" value="">
                  </form>
                </div>
              </div>
            </div>
          </div> -->

    <div class="content content-nav-base datails-content">
      <div class="main-nav">
        <div class="inner-cont0">
          <div class="inner-cont1 w1200">
            <div class="inner-cont2">
              <a href="./HotelUser-shop.html" class="active">所有商品</a>
              <!-- <a href="buytoday.html">今日团购</a>
                    <a href="information.html">母婴资讯</a>
                    <a href="about.html">关于我们</a> -->
            </div>
          </div>
        </div>
      </div>
      <div class="data-cont-wrap w1200">
        <div class="crumb">
          <a href="./HotelUser-shop.html">所有商品</a>
          <span>></span>
          <a href="javascript:;">产品详情</a>
        </div>
        <div class="product-intro layui-clear">
          <div class="preview-wrap">
            <a href="javascript:;"
              ><img src="res/static/img/details_img1.jpg"
            /></a>
          </div>
          <div class="itemInfo-wrap" id="cont">
            <!-- <div class="itemInfo">
                    <div class="title">
                      <h4>男女宝宝秋冬装套装0一1岁婴儿衣服潮加厚连体衣保暖冬季外出抱衣 </h4>
                      <span><i class="layui-icon layui-icon-rate-solid"></i>收藏</span>
                    </div>
                    <div class="summary" style="height: 300px;">
                      <p class="reference"><span>售价</span> <strong class="price"><i>￥</i>99.00</strong></p>
                      <p class="activity"><span>会员点价</span><strong class="price"><i>￥</i>99.00</strong></p>
                      <p class="address-box"><span>送&nbsp;&nbsp;&nbsp;&nbsp;至</span><strong class="address">江西&nbsp;&nbsp;南昌&nbsp;&nbsp;东湖区</strong></p>
                      
                    </div>
                    <div class="choose-attrs">
                      <div class="number layui-clear"><span class="title">数&nbsp;&nbsp;&nbsp;&nbsp;量</span><div class="number-cont"><span class="cut btn">-</span><input onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" maxlength="4" type="" name="" value="1"><span class="add btn">+</span></div></div>
                    </div>
                    <div class="choose-btns">
                      <button class="layui-btn layui-btn-primary purchase-btn">立刻购买</button>
                      <button class="layui-btn  layui-btn-danger car-btn"><i class="layui-icon layui-icon-cart-simple"></i>加入购物车</button>  
                    </div>
                  </div> -->
          </div>
        </div>
        <div class="layui-clear">
          <!-- <div class="aside">
                  <h4>热销推荐</h4>
                  <div class="item-list">
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                    <div class="item">
                      <img src="res/static/img/details_img2.jpg">
                      <p><span>可爱宝宝粉色连体秋裤</span><span class="pric">￥99.00</span></p>
                    </div>
                  </div>
                </div> -->
          <div class="detail">
            <h4>详情</h4>
            <div class="item" id="describe">
              <img src="res/static/img/details_imgbig.jpg" />
            </div>
          </div>
        </div>
      </div>
    </div>

    <script src="./HotelUser/assets/js/vendor/modernizr-2.6.2.min.js"></script>
    <script src="./HotelUser/assets/js/jquery-1.10.2.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="./HotelUser/assets/js/bootstrap-select.min.js"></script>
    <script src="./HotelUser/assets/js/bootstrap-hover-dropdown.js"></script>
    <script src="./HotelUser/assets/js/easypiechart.min.js"></script>
    <script src="./HotelUser/assets/js/jquery.easypiechart.min.js"></script>
    <script src="./HotelUser/assets/js/owl.carousel.min.js"></script>
    <script src="./HotelUser/assets/js/wow.js"></script>
    <script src="./HotelUser/assets/js/icheck.min.js"></script>
    <script src="./HotelUser/assets/js/price-range.js"></script>
    <script
      type="text/javascript"
      src="./HotelUser/assets/js/lightslider.min.js"
    ></script>
    <script src="./HotelUser/assets/js/main.js"></script>
    <script type="text/javascript">
      layui
        .config({
          base: "res/static/js/util/", //你存放新模块的目录，注意，不是layui的模块目录
        })
        .use(["mm", "jquery"], function () {
          var mm = layui.mm,
            $ = layui.$;
          var cur = $(".number-cont input").val();
          $(".number-cont .btn").on("click", function () {
            if ($(this).hasClass("add")) {
              cur++;
            } else {
              if (cur > 1) {
                cur--;
              }
            }
            $(".number-cont input").val(cur);
          });
        });
    </script>

    <script>
      var user = JSON.parse(localStorage.getItem("nowuser"));
      console.log("user=", user);
      if(user==null){
        alert("请登录")
        window.location.href='./index.html'
      }
      function buynow() {
        var aa = $("#number").val();
        var price = aa * data.cashPrice;
 
        localStorage
      }
      function addcart() {
        var aa = $("#number").val();
        // alert(aa);
        console.log(data);
        // paydata=''
        if(data.cashPrice!=-1){
        if (aa != 0) {
          // paydata += { userId: user.id, goosId: data.id, number: aa };
          paydata = { userId:user.id, goodsId: data.id, number: aa };
          // paydata =
          //   '{"userId": "1","goodsId":' + data.id + ',"number":' + aa + "}";

          // alert(paydata);
          console.log(paydata);
          $.ajax({
            type: "Get",
            contentType: "application/json", //必须这样写
            dataType: "json",
            data: paydata,
            url: "https://douzi.wiki:7000/GROW/api/cart/add",
            success: function (data) {
              alert("添加成功")
              console.log("aaa");
            },
          });
        }}
        else{
          alert("添加失败！此商品只可用积分")
        }
      }
      var strPath = window.document.location.pathname;
      // alert(strPath)
      var id = location.search;
      var id = decodeURI(document.URL); //获取到编码的数据并进行解码，推荐
      //获取到的数据其实是  ?uname=zhangsan'
      //下面是对数据进行处理
      var did = id.slice(id.indexOf("=") + 1);
      console.log(did);
      // console.log(data);
      var data = JSON.parse(localStorage.getItem("productdetailsdata"));
      localStorage.removeItem("shopdetailsdata");
      console.log("data=",data);
      if (did != null && data.id == did) {
        // alert(Date())
        // var roomnuber=''
        // if()
        
        //    alert(did)
        var h = "";
        h +=
          "<div class='itemInfo'>" +
          "<div class='title'>" +
          "<h4>" +
          data.name +
          "</h4>" +
          // "<span><i class='layui-icon layui-icon-rate-solid'></i>收藏</span>"+
          "</div>" +
          "<div class='summary' style='height: 300px;'>" +
          "<p class='reference'><span>售价</span> <strong class='price' style='font-size:30px'><i>￥</i>" +
          data.cashPrice +
          "</strong></p>" +
          "<p class='activity'><span>会员点价</span><strong class='price'><i></i>*" +
          data.pointsPrice +
          "</strong></p>" +
          "<p class='address-box'><span>送&nbsp;&nbsp;&nbsp;&nbsp;至</span><strong class='address'>房间号</strong></p>" +
          "</div>" +
          "<div class='choose-attrs'>" +
          "<div class='number layui-clear'><span class='title'>数&nbsp;&nbsp;&nbsp;&nbsp;量</span>" +
          "<div class='number-cont'><span class='cut btn'>-</span>" +
          "<input id='number' onkeyup='if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}' onafterpaste='if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}' maxlength='4' type='' name='' value='1'>" +
          "<span class='add btn'>+</span>" +
          "</div>" +
          "</div>" +
          "</div>" +
          "<div class='choose-btns'>" +
          "<button class='layui-btn layui-btn-primary purchase-btn' onclick='buynow();'>立即支付</button>" +
          "<button class='layui-btn layui-btn-primary purchase-btn' onclick='pointbuy();'>积分购买</button>" +
          "<button onclick='addcart();'  class='layui-btn  layui-btn-danger car-btn'><i class='layui-icon layui-icon-cart-simple'></i>加入购物车</button>" +
          "</div>" +
          "</div>";
        document.getElementById("cont").innerHTML = h;
        var d=''
        d+="<div><h4>描述："+data.describe+"</h4></div>"+
        "<img src='res/static/img/details_imgbig.jpg' />"
        document.getElementById("describe").innerHTML = d;
      } else {
        alert("请重新选择产品");
        window.location.href = "./HotelUser-shop.html";
      }

      function order() {
        window.location.href = "./HotelUser-hotel-pay.html";
      }

      window.onunload = function () {
        localStorage.removeItem("shopdetailsdata");
      };
      function pointbuy() {
        // if(user.pointsPrice>=data.pointsPrice)
        //ajax
        alert(data.pointsPrice);
        alert("支付成功");
      }
    </script>
  </body>
</html>
